#include "CandidateExtractor.h"
Candidate::Candidate()
{

}

CandidateExtractor::CandidateExtractor()
{

}
void CandidateExtractor::setObjects(vector<LSfeatureObject> objts)
{
    for(vector<LSfeatureObject>::iterator iit = objts.begin();iit != objts.end();iit++)
        if((iit)->confidenceFactor > 0.4 )
        {
          objects.push_back(*(iit)/*->CopyTo()*/);
        }

}
vector <Candidate>  CandidateExtractor::doExtractor(double maxDist, double minDist)
{
    int i = 0;
    int startIndex;
    vector<Candidate> canVec;
    while ( i < objects.size() )
    {

        LSfeatureObject obj1 = objects[i];
      //  if( (obj1.getMiddlePoint().getR() > maxDist) || (obj1.getMiddlePoint().getR() < minDist))
          //  continue;
        Candidate *c = new Candidate(obj1);
        canVec.push_back(*c);
                delete(c);
        i++;
    }
    return canVec;
}

vector<Candidate*> CandidateExtractor::getCandidates()
{
    vector<Candidate*> candidates;
        while (objects.size()!= 0)
        {
                vector<LSfeatureObject>::iterator it1 = objects.begin();
                candidates.insert( candidates.end() , new Candidate((*it1)) );
                objects.erase(it1);
            it1++;
        }
        objects.clear();
   return candidates;
}


